package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import java.util.List;

import retrofit2.Call;

/**
 * 类说明：
 * 作者：huangqiuxin on 2016/5/14 14:27
 * 邮箱：648859026@qq.com
 */
public class GuideAddAction extends AHttpService<PbBean.PbResGuideAdd>{
    /**
     * 添加搭配指导
     * @param context
     * @param content 内容
     * @param imageTokenList 图片列表
     * @return
     */
    public static GuideAddAction newInstance(Context context,  String content, List<String> imageTokenList,String designerId){
        return new GuideAddAction(context,  content, imageTokenList,designerId);
    }
    private String content;
    private List<String> imageTokenList;
    private String designerId;
    private GuideAddAction(Context context,  String content, List<String> imageTokenList,String designerId) {
        super(context);
        this.content = content;
        this.imageTokenList = imageTokenList;
        this.designerId=designerId;
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqGuideAdd.Builder builder = PbBean.PbReqGuideAdd.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setContent(content);
        builder.addAllImageTokenList(imageTokenList);
        builder.setDesignerId(designerId);

        return apiService.guideAdd(builder.build());
    }
}
